package com.mikey.springcloud.controller;

import com.mikey.springcloud.pojo.Category;
import com.mikey.springcloud.service.CategoryClientService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import java.util.List;

/**
 * @author :Mikey
 * @description :
 * @create :2022-08-29 21:25:00
 */
@RestController
public class CategoryController {

    @Autowired
    private CategoryClientService service;

    @RequestMapping("/consumer/category/list")
    public List<Category> list() {
        return service.list();
    }
    @RequestMapping("/consumer/category/select/{id}")
    public Category findOne(@PathVariable("id") Integer id) {
        System.out.println(id);
        return service.findOne(id);
    }

}
